package listbyorder.access101_200.test189;

/**
 * @author code_yc
 * @version 1.0
 * @date 2020/6/15 13:07
 */
public class Solution3 {

    public void rotate(int[] nums, int k) {
        int n = nums.length;
        k %= n;
        for (int i = 0; i < k; i++) {
            int temp = nums[n - 1];
            for (int j = n - 1; j > 0; j--) {
                nums[j] = nums[j - 1];
            }
            nums[0] = temp;
        }
    }

}
